//
//  CYCertificationInfoViewController.m
//  cyjf
//
//  Created by tauCross on 2017/5/17.
//  Copyright © 2017年 Auto Financing. All rights reserved.
//

#import "CYCertificationInfoViewController.h"



@interface CYCertificationInfoViewController ()

@property(nonatomic, strong)UIImageView *iconImageView;
@property(nonatomic, strong)UILabel *certificationDescLabel;
@property(nonatomic, strong)UIView *infoView;
@property(nonatomic, strong)UIView *infoLine;
@property(nonatomic, strong)UILabel *nameDescLabel;
@property(nonatomic, strong)UILabel *nameLabel;
@property(nonatomic, strong)UILabel *idNumberDescLabel;
@property(nonatomic, strong)UILabel *idNumberLabel;

@end


@implementation CYCertificationInfoViewController

- (void)loadUI
{
    self.navigationItem.title = @"实名认证";
    self.tableView.hidden = YES;
    
    self.iconImageView = [[UIImageView alloc] initWithImage:CYImage(@"certification_info_icon")];
    [self.contentView addSubview:self.iconImageView];
    
    self.certificationDescLabel = [[UILabel alloc] init];
    self.certificationDescLabel.text = @"您已通过实名认证，如需要帮助请联系客服";
    self.certificationDescLabel.textColor = HEXCOLOR(@"888888");
    self.certificationDescLabel.font = [UIFont systemFontOfSize:14];
    [self.certificationDescLabel sizeToFit];
    [self.contentView addSubview:self.certificationDescLabel];
    
    self.infoView = [[UIView alloc] init];
    self.infoView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.infoView];
    {
        self.infoLine = [UIView cy_lineWithColor:HEXCOLOR(@"ECECEC")];
        [self.infoView addSubview:self.infoLine];
        
        self.nameDescLabel = [[UILabel alloc] init];
        self.nameDescLabel.font = [UIFont systemFontOfSize:16];
        self.nameDescLabel.textColor = HEXCOLOR(@"444444");
        self.nameDescLabel.text = @"真实姓名";
        [self.nameDescLabel sizeToFit];
        [self.infoView addSubview:self.nameDescLabel];
        
        self.nameLabel = [[UILabel alloc] init];
        self.nameLabel.textColor = HEXCOLOR(@"999999");
        self.nameLabel.font = [UIFont systemFontOfSize:14];
        [self.infoView addSubview:self.nameLabel];
        
        self.idNumberDescLabel = [[UILabel alloc] init];
        self.idNumberDescLabel.font = [UIFont systemFontOfSize:16];
        self.idNumberDescLabel.textColor = HEXCOLOR(@"444444");
        self.idNumberDescLabel.text = @"身份证号";
        [self.idNumberDescLabel sizeToFit];
        [self.infoView addSubview:self.idNumberDescLabel];
        
        self.idNumberLabel = [[UILabel alloc] init];
        self.idNumberLabel.textColor = HEXCOLOR(@"999999");
        self.idNumberLabel.font = [UIFont systemFontOfSize:14];
        [self.infoView addSubview:self.idNumberLabel];
    }
}

- (void)loadData
{
    self.nameLabel.text = self.name;
    self.idNumberLabel.text = self.idNumber;
}

- (void)layoutUI
{
    self.iconImageView.left = 20;
    self.iconImageView.top = 24;
    
    self.certificationDescLabel.centerY = self.iconImageView.centerY;
    self.certificationDescLabel.left = self.iconImageView.right + 4;
    
    self.infoView.width = self.contentView.width;
    self.infoView.height = 100;
    self.infoView.left = 0;
    self.infoView.top = 46;
    {
        self.infoLine.width = self.infoView.width - 20;
        self.infoLine.height = 1 / SCREEN_SCALE;
        self.infoLine.left = 20;
        self.infoLine.centerY = self.infoView.height / 2;
        
        self.nameDescLabel.centerY = 25;
        self.nameDescLabel.left = 20;
        
        self.idNumberDescLabel.centerY = 75;
        self.idNumberDescLabel.left = 20;
        
        [self.nameLabel sizeToFit];
        self.nameLabel.centerY = self.nameDescLabel.centerY;
        self.nameLabel.right = self.infoView.width - 20;
        
        [self.idNumberLabel sizeToFit];
        self.idNumberLabel.centerY = self.idNumberDescLabel.centerY;
        self.idNumberLabel.right = self.infoView.width - 20;
    }
}

@end
